class Category < ActiveRecord::Base
  def self.find_category(obj)
    return Category.find_by_name(obj.class.name)||Category.find_by_name(obj.class.superclass.name)
  end
  
  def self.find_object(object_id,category_id)
    return eval(Category.find_by_id(category_id).name).find_by_id(object_id)
  rescue
    return Incumbent.find_by_id(object_id)
  end  
end
